#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int print(int a,int b)
{
	int temp = a ^ b;
	int count = 0;
	while (temp != 0)
	{
		count++;
		temp = temp & (temp - 1);
	}
	return count;
}
int main()
{
	int a = 0, b = 0;
	scanf("%d%d", &a, &b);
	int ret=print(a, b);
	printf("%d", ret);
	return 0;
}